from rest_framework.serializers import ModelSerializer
from .models import *
from rest_framework import serializers  #普通序列化器

#新闻
class MNewSer(ModelSerializer):
    class Meta:
        model = MNew
        fields = '__all__'

#广告
class MadvertisingmanageSer(ModelSerializer):
    class Meta:
        model = Madvertising
        fields = '__all__'

#美多开始

#注册用户
class CreatCaptchaSer(ModelSerializer):
    class Meta:
        model = User
        fields = '__all__'

#新增地址
class AddressManageSer(ModelSerializer):
    class Meta:
        model = Address
        fields = '__all__'

#三级联动、
class AreaSer(ModelSerializer):
    class Meta:
        model = Area
        fields = '__all__'

#展示 地址 收货人等
class ShowaddressSer(ModelSerializer):
    user = serializers.StringRelatedField()
    province = serializers.StringRelatedField()
    city = serializers.StringRelatedField()
    area = serializers.StringRelatedField()
    class Meta:
        model = Address
        fields = '__all__'
